#pragma once

#include <memory>
#include <map>
#include "model/ClientNode.h"
#include "protocol/transport.pb.h"
#include "protocol/routeinfo.pb.h"
#include "base/Uri.h"

#include "base/Define.h"

namespace zeroplus::mq::admin
{
    class TopicManager
    {
    private:
        std::map<std::string, std::shared_ptr<ClientNode>> clientList_;

    public:
        TopicManager();
        ~TopicManager();
        void ConnectToAllBrokerServer(const routeinfo::ClusterInfo &clusterInfo);
        bool AddTopic(const std::shared_ptr<ClientNode> &client, const std::string &topic);
        bool AddTopic(const std::vector<std::vector<std::string>> &topic2D);
        bool DelTopic(const std::string &topic);
        void Start();
    };
}